'use strict';

var draggable = require('vuedraggable');
var ylyFormConstants = require('yly-form-source/lib/yly-form-constants');
var ylyFormSource = require('yly-form-source');
var cloneDeep = require('lodash/cloneDeep');
var VxeGridMixin = require('@/mixins/VxeGridMixin');
var require$$0 = require('vue');
var FormMixin = require('yly-form-source/lib/yly-form-mixin');
require('@/utils/util');

var script$b = {
    name: "CollapseItem",
    components: {
        Draggable: draggable
    },
    props: {
        widgetDict: {
            type: Object,
            default: () => ({})
        },
        list: {
            type: Array,
            default: () => []
        },
        isShowModel: {
            type: Boolean,
            default: false
        }
    },
    methods: {
        onChoose(event) {
            console.log('onChoose', event);
        },
        unChoose(event) {
            console.log('unChoose', event);
        }
    }
};

function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
    if (typeof shadowMode !== 'boolean') {
        createInjectorSSR = createInjector;
        createInjector = shadowMode;
        shadowMode = false;
    }
    // Vue.extend constructor export interop.
    var options = typeof script === 'function' ? script.options : script;
    // render functions
    if (template && template.render) {
        options.render = template.render;
        options.staticRenderFns = template.staticRenderFns;
        options._compiled = true;
        // functional template
        if (isFunctionalTemplate) {
            options.functional = true;
        }
    }
    // scopedId
    if (scopeId) {
        options._scopeId = scopeId;
    }
    let hook;
    if (moduleIdentifier) {
        // server build
        hook = function (context) {
            // 2.3 injection
            context =
                context || // cached call
                    (this.$vnode && this.$vnode.ssrContext) || // stateful
                    (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
            // 2.2 with runInNewContext: true
            if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
                context = __VUE_SSR_CONTEXT__;
            }
            // inject component styles
            if (style) {
                style.call(this, createInjectorSSR(context));
            }
            // register component module identifier for async chunk inference
            if (context && context._registeredComponents) {
                context._registeredComponents.add(moduleIdentifier);
            }
        };
        // used by ssr in case component is cached and beforeCreate
        // never gets called
        options._ssrRegister = hook;
    }
    else if (style) {
        hook = shadowMode
            ? function (context) {
                style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
            }
            : function (context) {
                style.call(this, createInjector(context));
            };
    }
    if (hook) {
        if (options.functional) {
            // register for functional component in vue file
            var originalRender = options.render;
            options.render = function renderWithStyleInjection(h, context) {
                hook.call(context);
                return originalRender(h, context);
            };
        }
        else {
            // inject component registration as beforeCreate hook
            var existing = options.beforeCreate;
            options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
        }
    }
    return script;
}

/* script */ var __vue_script__$b = script$b;
/* template */
var __vue_render__$a = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "draggable",
    _vm._b(
      { staticClass: "form-drag-list", attrs: { tag: "ul", value: _vm.list } },
      "draggable",
      {
        group: { name: "form-draggable", pull: "clone", put: false },
        sort: false,
        animation: 180,
        ghostClass: "moving"
      },
      false
    ),
    _vm._l(_vm.list, function(val, index) {
      return _c("li", { key: index, attrs: { "data-type": val } }, [
        _c(
          "div",
          { staticClass: "form-comp-item" },
          [
            _c("div", { staticClass: "form-comp-icon" }, [
              val.icon
                ? _c(
                    "svg",
                    {
                      attrs: {
                        width: "14",
                        height: "14",
                        "aria-hidden": "true"
                      }
                    },
                    [_c("use", { attrs: { "xlink:href": "#" + val.icon } })]
                  )
                : _vm._e()
            ]),
            _vm._v(" "),
            _c("g-ellipsis", {
              attrs: { content: val.label, maxWidth: "80px" }
            })
          ],
          1
        ),
        _vm._v(" "),
        _vm.isShowModel && val.model
          ? _c("div", [_vm._v(_vm._s(val.model))])
          : _vm._e()
      ])
    }),
    0
  )
};
var __vue_staticRenderFns__$a = [];
__vue_render__$a._withStripped = true;

  /* style */
  var __vue_inject_styles__$b = undefined;
  /* scoped */
  var __vue_scope_id__$b = undefined;
  /* module identifier */
  var __vue_module_identifier__$b = undefined;
  /* functional template */
  var __vue_is_functional_template__$b = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$b = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
    __vue_inject_styles__$b,
    __vue_script__$b,
    __vue_scope_id__$b,
    __vue_is_functional_template__$b,
    __vue_module_identifier__$b,
    false,
    undefined,
    undefined,
    undefined
  );

var script$a = {
    name: 'BaseFormComponentList',
    components: {
        CollapseItem: __vue_component__$b
    },
    props: {
        groupConfigObj: {
            type: Object,
            default() {
                return {};
            }
        }
    },
    data() {
        return {
            startType: ""
        };
    },
    computed: {},
    methods: {
        handleStart(type) {
            this.startType = type;
        },
        generateKey(list, index) {
            var key = list[index].type + "_" + new Date().getTime();
            this.$set(list, index, {
                ...list[index],
                key,
                model: list[index].type === "KDistpickerSelect" ? key : ""
            });
            if (ylyFormConstants.NO_MODEL_COMPONENTS.includes(list[index].type)) {
                delete list[index].model;
            }
        }
    }
};

/* script */ var __vue_script__$a = script$a;
/* template */
var __vue_render__$9 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "a-collapse",
    { attrs: { defaultActiveKey: ["1", "2", "3"] } },
    [
      _vm.groupConfigObj.basicsArray.length > 0
        ? _c(
            "a-collapse-panel",
            { key: "1", attrs: { header: "基础控件" } },
            [
              _c("collapse-item", {
                attrs: { list: _vm.groupConfigObj.basicsArray },
                on: { generateKey: _vm.generateKey, start: _vm.handleStart }
              })
            ],
            1
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.groupConfigObj.layoutArray.length > 0
        ? _c(
            "a-collapse-panel",
            { key: "2", attrs: { header: "布局控件" } },
            [
              _c("collapse-item", {
                attrs: { list: _vm.groupConfigObj.layoutArray },
                on: { generateKey: _vm.generateKey, start: _vm.handleStart }
              })
            ],
            1
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.groupConfigObj.bussinessArray.length > 0
        ? _c(
            "a-collapse-panel",
            { key: "3", attrs: { header: "业务控件" } },
            [
              _c("collapse-item", {
                attrs: { list: _vm.groupConfigObj.bussinessArray },
                on: { generateKey: _vm.generateKey, start: _vm.handleStart }
              })
            ],
            1
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.groupConfigObj.customBusinessList.length > 0
        ? _c(
            "a-collapse-panel",
            { key: "4", attrs: { header: "自开发应用组件" } },
            [
              _c("collapse-item", {
                attrs: { list: _vm.groupConfigObj.customBusinessList },
                on: { generateKey: _vm.generateKey, start: _vm.handleStart }
              })
            ],
            1
          )
        : _vm._e()
    ],
    1
  )
};
var __vue_staticRenderFns__$9 = [];
__vue_render__$9._withStripped = true;

  /* style */
  var __vue_inject_styles__$a = undefined;
  /* scoped */
  var __vue_scope_id__$a = undefined;
  /* module identifier */
  var __vue_module_identifier__$a = undefined;
  /* functional template */
  var __vue_is_functional_template__$a = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$a = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
    __vue_inject_styles__$a,
    __vue_script__$a,
    __vue_scope_id__$a,
    __vue_is_functional_template__$a,
    __vue_module_identifier__$a,
    false,
    undefined,
    undefined,
    undefined
  );

var script$9 = {
    name: "DisplayFieldList",
    components: {
        CollapseItem: __vue_component__$b
    },
    props: {
        formSource: {
            type: Object,
            required: true
        },
        renderType: {
            type: String,
            default: 'show'
        },
        showComponentConfig: {
            type: Object,
            default() {
                return {};
            }
        },
        tableComponentList: {
            type: Array,
            default() {
                return [];
            }
        }
    },
    data() {
        return {
            searchVal: ""
        };
    },
    computed: {
        formFieldList() {
            let formFieldList = [];
            if (this.renderType === 'table') {
                formFieldList = this.tableComponentList.map(item => {
                    return {
                        ...item,
                        label: item.componentName,
                        model: item.componentId,
                        code: 'FORM_TABLE',
                        configEvents: ['onMounted']
                    };
                });
            } else {
                formFieldList = this.showComponentConfig.fieldConfigAfterAnalysis && this.showComponentConfig.fieldConfigAfterAnalysis.map(item => {
                    var componentConfig = this.formSource.constructor.FormComponentsControl.getComponentConfigByField(item);
                    if (componentConfig) {
                        componentConfig.label = item.columnText;
                        componentConfig.model = item.columnName;
                        componentConfig.fieldConfig = item;
                    }
                    return componentConfig;
                });
            }
            if (!this.searchVal) return formFieldList;
            return formFieldList.filter(item => item.label.indexOf(this.searchVal) !== -1);
        }
    },
    mounted() {},
    methods: {
        handleStart(type) {},
        generateKey(list, index) {
            var key = list[index].type + "_" + new Date().getTime();
            this.$set(list, index, {
                ...list[index],
                key,
                model: list[index].type === "KDistpickerSelect" ? key : list[index].model
            });
            if (ylyFormConstants.NO_MODEL_COMPONENTS.includes(list[index].type)) {
                delete list[index].model;
            }
        }
    }
};

/* script */ var __vue_script__$9 = script$9;
/* template */
var __vue_render__$8 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "display-field-list" },
    [
      _c("a-input-search", {
        staticStyle: { margin: "12px 0" },
        attrs: { placeholder: _vm.$t("请输入关键字检索") },
        model: {
          value: _vm.searchVal,
          callback: function($$v) {
            _vm.searchVal = $$v;
          },
          expression: "searchVal"
        }
      }),
      _vm._v(" "),
      _c("collapse-item", {
        attrs: { list: _vm.formFieldList },
        on: { generateKey: _vm.generateKey, start: _vm.handleStart }
      })
    ],
    1
  )
};
var __vue_staticRenderFns__$8 = [];
__vue_render__$8._withStripped = true;

  /* style */
  var __vue_inject_styles__$9 = undefined;
  /* scoped */
  var __vue_scope_id__$9 = undefined;
  /* module identifier */
  var __vue_module_identifier__$9 = undefined;
  /* functional template */
  var __vue_is_functional_template__$9 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$9 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
    __vue_inject_styles__$9,
    __vue_script__$9,
    __vue_scope_id__$9,
    __vue_is_functional_template__$9,
    __vue_module_identifier__$9,
    false,
    undefined,
    undefined,
    undefined
  );

var script$8 = {
    name: 'FormDesignList',
    components: {
        BaseFormComponentList: __vue_component__$a,
        DisplayFieldList: __vue_component__$9
    },
    props: {
        formSource: {
            type: Object,
            required: true
        },
        formActionType: {
            type: String,
            default: 'baseForm'
        },
        showComponentConfig: {
            type: Object,
            default() {
                return {};
            }
        },
        tableComponentList: {
            type: Array,
            default() {
                return [];
            }
        }
    },
    data() {
        return {
            DEFAULT_FORM_GROUP: ylyFormSource.FormSource.FormComponentsControl.groupMap.get('DEFAULT_FORM_GROUP'),
            groupConfigObj: {
                basicsArray: [],
                layoutArray: [],
                bussinessArray: [],
                customBusinessList: []
            }
        };
    },
    computed: {
        layoutElementConfig() {
            var layoutElementConfig = {};
            for (let key in this.groupConfigObj) {
                if (Array.isArray(this.groupConfigObj[key])) {
                    var showComponent = this.groupConfigObj[key].filter(item => ylyFormConstants.NO_MODEL_COMPONENTS_CODE.includes(item.code));
                    layoutElementConfig[key] = showComponent;
                } else {
                    layoutElementConfig[key] = this.groupConfigObj[key];
                }
            }
            return layoutElementConfig;
        }
    },
    created() {
        this.initGroupList();
    },
    methods: {
        initGroupList() {
            var {renderClient} = this.formSource.sourceContent;
            var groupConfigList = ylyFormSource.FormSource.FormComponentsControl.getGroupConfig('DEFAULT_FORM_GROUP');
            if (Array.isArray(groupConfigList)) {
                var basicsList = groupConfigList.find(item => item.groupType === 'basicsList');
                this.groupConfigObj.basicsArray = basicsList ? basicsList.groupCompList : [];
                var layoutList = groupConfigList.find(item => item.groupType === 'layoutList');
                this.groupConfigObj.layoutArray = layoutList ? layoutList.groupCompList : [];
                var businessList = groupConfigList.find(item => item.groupType === 'businessList');
                this.groupConfigObj.bussinessArray = businessList ? businessList.groupCompList : [];
                var customBusinessList = groupConfigList.find(item => item.groupType === 'customBusinessList');
                this.groupConfigObj.customBusinessList = customBusinessList ? customBusinessList.groupCompList : [];
                if (renderClient === 'WEB') {
                    this.groupConfigObj.layoutArray = this.groupConfigObj.layoutArray.filter(item => !['FORM_GRID_BOX'].includes(item.code));
                }
                if (renderClient === 'MOBILE') {
                    this.groupConfigObj.layoutArray = this.groupConfigObj.layoutArray.filter(item => !['FORM_GRID', 'FORM_MY_FIELD'].includes(item.code));
                    this.groupConfigObj.bussinessArray = this.groupConfigObj.bussinessArray.filter(item => !['FORM_USER_SELECT', 'FORM_ORG_SELECT'].includes(item.code));
                    this.groupConfigObj.bussinessArray = this.groupConfigObj.bussinessArray.filter(item => !ylyFormConstants.CUSTOM_DEV_COMPONENT_CODE.includes(item.code));
                }
            }
        },
        generateKey(list, index) {
            var key = list[index].type + "_" + new Date().getTime();
            this.$set(list, index, {
                ...list[index],
                key,
                model: list[index].type === "KDistpickerSelect" ? key : ""
            });
            console.log(list[index]);
            if (ylyFormConstants.NO_MODEL_COMPONENTS.includes(list[index].type)) {
                delete list[index].model;
            }
        }
    }
};

/* script */ var __vue_script__$8 = script$8;
/* template */
var __vue_render__$7 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "aside",
    { staticClass: "form-design-list" },
    [
      _vm.formActionType === "displayForm"
        ? _c(
            "a-tabs",
            { attrs: { "default-active-key": "fieldList" } },
            [
              _c(
                "a-tab-pane",
                { key: "fieldList", attrs: { tab: "字段列表" } },
                [
                  _c("display-field-list", {
                    attrs: {
                      showComponentConfig: _vm.showComponentConfig,
                      formSource: _vm.formSource
                    }
                  })
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "a-tab-pane",
                { key: "baseForm", attrs: { tab: "布局元素" } },
                [
                  _c("base-form-component-list", {
                    attrs: { groupConfigObj: _vm.layoutElementConfig }
                  })
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "a-tab-pane",
                { key: "tableForm", attrs: { tab: "表格组件" } },
                [
                  _c("display-field-list", {
                    attrs: {
                      renderType: "table",
                      tableComponentList: _vm.tableComponentList,
                      formSource: _vm.formSource
                    }
                  })
                ],
                1
              )
            ],
            1
          )
        : _c("base-form-component-list", {
            attrs: { groupConfigObj: _vm.groupConfigObj }
          })
    ],
    1
  )
};
var __vue_staticRenderFns__$7 = [];
__vue_render__$7._withStripped = true;

  /* style */
  var __vue_inject_styles__$8 = undefined;
  /* scoped */
  var __vue_scope_id__$8 = undefined;
  /* module identifier */
  var __vue_module_identifier__$8 = undefined;
  /* functional template */
  var __vue_is_functional_template__$8 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$8 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
    __vue_inject_styles__$8,
    __vue_script__$8,
    __vue_scope_id__$8,
    __vue_is_functional_template__$8,
    __vue_module_identifier__$8,
    false,
    undefined,
    undefined,
    undefined
  );

var script$7 = {
    name: 'YlyFormItemWrapper',
    functional: true,
    inject: [],
    props: {
        componentConfig: {
            type: Object,
            required: true
        },
        formSource: {
            type: Object,
            default: () => ({})
        },
        isSubComponent: {
            type: Boolean,
            default: false
        },
        renderScene: {
            type: String,
            required: true,
            validator: function (value) {
                var renderSceneList = ['ide', 'edit', 'read'];
                return renderSceneList.includes(value);
            }
        },
        parentWidget: {
            type: Object
        }
    },
    render: function (h, context) {
        var {componentConfig, formSource, renderScene, isSubComponent, parentWidget} = context.props;
        var calcComponentConfig = () => {
            if (!componentConfig.version || componentConfig.version !== 'v2.0') {
                formSource && formSource.formComponentsControl.constructor.convertOldComponentConfig(componentConfig);
            }
            return componentConfig;
        };
        var computedComponentConfig = calcComponentConfig();
        var clickItemWrapper = $event => {
            $event.stopPropagation();
            context.listeners.selectedItem && context.listeners.selectedItem(computedComponentConfig);
        };
        var handleChange = value => {
            context.parent.handleChange && context.parent.handleChange(value, calcComponentConfig.model);
        };
        var addItemInContainer = $event => {
            context.listeners.addItemInContainer && context.listeners.addItemInContainer($event);
        };
        var isRequired = computedComponentConfig.rules && computedComponentConfig.rules[0] && computedComponentConfig.rules[0].required;
        var getRenderCompName = () => {
            var originConfig = formSource.formComponentsControl.constructor.getComponentConfigByCode(computedComponentConfig.code);
            let renderCompName = originConfig.renderComponent[renderScene];
            return renderCompName;
        };
        var clickCopyAdd = $event => {
            $event.stopPropagation();
            $event.preventDefault();
            context.listeners.handleCopyComponent && context.listeners.handleCopyComponent(computedComponentConfig);
        };
        var clickDeleteOption = $event => {
            $event.stopPropagation();
            $event.preventDefault();
            context.listeners.deleteItem && context.listeners.deleteItem(computedComponentConfig.key);
        };
        var ideRenderOptions = h('div', {
            class: "form-item-options"
        }, [h('div', {
            class: "options-icon",
            on: {
                click: clickCopyAdd
            }
        }, [h('a-icon', {
            attrs: {
                type: "copy"
            }
        })]), h('div', {
            class: "options-icon",
            on: {
                click: clickDeleteOption
            }
        }, [h('a-icon', {
            attrs: {
                type: "delete"
            }
        })])]);
        var renderWrapperClass = () => {
            var ideClass = {
                'ide-display-component': computedComponentConfig.hidden,
                'select-form-item': computedComponentConfig.key === formSource.selectedComponent.key,
                'ide-item-wrapper': true,
                'hidden-comp': computedComponentConfig.hidden
            };
            var renderWrapperClass = {
                'form-item-wrapper': true,
                'is-required': isRequired
            };
            if (renderScene === 'ide') {
                Object.assign(renderWrapperClass, ideClass);
            }
            return renderWrapperClass;
        };
        var FormNodeStyle = () => {
            let width = componentConfig.width;
            if (isSubComponent) {
                width = parseFloat(100 / parentWidget.colNum) + '%';
            }
            if (typeof width === 'string' && (width.slice(-1) === '%' || width.slice(-2) === 'px')) {
                return {
                    width: width
                };
            }
            return {
                width: width ? parseFloat(width) + '%' : '100%'
            };
        };
        var isShowOptions = renderScene === 'ide' && computedComponentConfig.key === formSource.selectedComponent.key;
        var getRenderScene = () => {
            var emptyRenderOptions = '';
            var RenderSceneTemp = h('div', {
                style: {
                    display: computedComponentConfig.hidden && renderScene !== 'ide' ? 'none' : 'block',
                    ...FormNodeStyle()
                },
                class: renderWrapperClass(),
                on: {
                    click: clickItemWrapper
                },
                attrs: {
                    'data-type': computedComponentConfig.componentType,
                    'data-component-id': computedComponentConfig.key
                }
            }, [isShowOptions ? ideRenderOptions : emptyRenderOptions, h(getRenderCompName(), {
                props: {
                    key: computedComponentConfig.key,
                    record: computedComponentConfig,
                    componentConfig: computedComponentConfig,
                    renderScene: renderScene,
                    formSource: formSource
                },
                style: {},
                on: {
                    addItemInContainer: addItemInContainer,
                    change: handleChange
                }
            })]);
            return RenderSceneTemp;
        };
        return getRenderScene();
    }
};

/* script */ var __vue_script__$7 = script$7;

/* template */

  /* style */
  var __vue_inject_styles__$7 = undefined;
  /* scoped */
  var __vue_scope_id__$7 = undefined;
  /* module identifier */
  var __vue_module_identifier__$7 = undefined;
  /* functional template */
  var __vue_is_functional_template__$7 = undefined;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$7 = /*#__PURE__*/normalizeComponent(
    {},
    __vue_inject_styles__$7,
    __vue_script__$7,
    __vue_scope_id__$7,
    __vue_is_functional_template__$7,
    __vue_module_identifier__$7,
    false,
    undefined,
    undefined,
    undefined
  );

var script$6 = {
    name: 'YlyFormItemContainer',
    components: {
        draggable,
        ylyFormItemWrapper: __vue_component__$7
    },
    props: {
        formSource: {
            type: Object,
            required: true
        },
        renderScene: {
            type: String,
            required: true
        },
        dragGroup: {
            type: Object,
            default: () => {
                return {
                    pull: function (to, from, item) {
                        if (to.options && to.options.group) {
                            return ['form-draggable', 'form-card', 'form-grid'].includes(to.options.group.name);
                        }
                        return false;
                    },
                    put: ['form-draggable', 'form-card', 'form-grid'],
                    name: 'form-draggable'
                };
            }
        },
        hideEmpty: {
            type: Boolean,
            default: false
        },
        parentChildKey: {
            type: String,
            default: () => 'children'
        },
        parentWidget: {
            type: Object
        },
        itemList: {
            type: Array,
            default() {
                return [];
            }
        }
    },
    data() {
        return {};
    },
    computed: {
        draggableOptions() {
            return {
                easing: 'cubic-bezier(1, 1, 1, 1)',
                animation: 200,
                fallbackOnBody: true,
                swapThreshold: 0.65,
                disabled: this.renderScene !== 'ide'
            };
        },
        isEmptyInIde() {
            return !this.hideEmpty && this.renderScene === 'ide' && this.formItemList.length === 0;
        },
        formItemList() {
            if (this.parentWidget) {
                return this.parentWidget[this.parentChildKey];
            } else {
                return this.itemList;
            }
        }
    },
    methods: {
        addItemInContainer($event) {
            console.log($event);
            if ($event.newIndex === 1 && this.formItemList.length === 1) {
                $event.newIndex = 0;
            }
            this.$emit('addItemInContainer', {
                formItemList: this.formItemList,
                parentWidget: this.parentWidget,
                widget: cloneDeep(this.formItemList[$event.newIndex]),
                $event: $event
            });
        },
        handleCopyComponent(widget) {
            this.formSource.formDataControl.copyItemInContainer({
                formItemList: this.formItemList,
                widget: cloneDeep(widget)
            });
        },
        updateItemInContainer($event) {
            console.log($event);
        },
        handleSelectItem(componentItem) {
            this.formSource.updateSelectedComponent(componentItem);
        },
        handleDeleteItem(key) {
            this.formSource.formDataControl.deleteItemInContainer({
                formItemList: this.formItemList,
                key
            });
        }
    }
};

/* script */ var __vue_script__$6 = script$6;
/* template */
var __vue_render__$6 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "form-item-container" },
    [
      _c(
        "draggable",
        _vm._b(
          {
            staticClass: "draggable-box",
            class: {
              "form-item-list-empty": _vm.isEmptyInIde
            },
            attrs: {
              list: _vm.formItemList,
              group: _vm.dragGroup,
              ghostClass: "moving",
              filter: ".form-item-list-empty",
              tag: "div"
            },
            on: {
              add: function($event) {
                return _vm.addItemInContainer($event)
              },
              update: function($event) {
                return _vm.updateItemInContainer($event)
              }
            }
          },
          "draggable",
          _vm.draggableOptions,
          false
        ),
        [
          _vm.isEmptyInIde
            ? _c("div", { staticClass: "form-item-list-empty" }, [
                _vm._v("\n      请添加数据\n    ")
              ])
            : _vm._l(_vm.formItemList, function(componentConfig, index) {
                return _c(
                  "yly-form-item-wrapper",
                  _vm._g(
                    _vm._b(
                      {
                        key: componentConfig.key,
                        staticClass: "drag-move",
                        attrs: {
                          componentConfig: componentConfig,
                          parentWidget: _vm.parentWidget,
                          formSource: _vm.formSource,
                          renderScene: _vm.renderScene
                        },
                        on: {
                          selectedItem: _vm.handleSelectItem,
                          deleteItem: _vm.handleDeleteItem,
                          handleCopyComponent: _vm.handleCopyComponent
                        }
                      },
                      "yly-form-item-wrapper",
                      _vm.$attrs,
                      false
                    ),
                    _vm.$listeners
                  )
                )
              })
        ],
        2
      )
    ],
    1
  )
};
var __vue_staticRenderFns__$6 = [];
__vue_render__$6._withStripped = true;

  /* style */
  var __vue_inject_styles__$6 = undefined;
  /* scoped */
  var __vue_scope_id__$6 = undefined;
  /* module identifier */
  var __vue_module_identifier__$6 = undefined;
  /* functional template */
  var __vue_is_functional_template__$6 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$6 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
    __vue_inject_styles__$6,
    __vue_script__$6,
    __vue_scope_id__$6,
    __vue_is_functional_template__$6,
    __vue_module_identifier__$6,
    false,
    undefined,
    undefined,
    undefined
  );

var script$5 = {
    name: 'YlyFormBuild',
    components: {
        YlyFormItemContainer: __vue_component__$6
    },
    props: {
        ideFormData: {
            type: Object,
            default() {
                return {};
            }
        },
        formSource: {
            type: Object,
            required: true
        }
    },
    computed: {
        formData() {
            return this.formSource.formDataControl && this.formSource.formDataControl.formData || ({});
        },
        formItemList: {
            get() {
                return this.formSource && this.formSource.formDataControl && this.formSource.formDataControl.formItemList;
            },
            set(val) {
                if (this.formSource && this.formSource.formDataControl) {
                    this.formSource.formDataControl.setFormList(val);
                }
            }
        },
        renderScene() {
            return this.formSource.sourceContent.renderScene;
        }
    },
    data() {
        return {};
    },
    created() {},
    methods: {
        addItemInContainer(content) {
            var {formItemList, widget, $event, parentWidget} = content;
            delete widget.editor;
            delete widget.mobileEditor;
            this.formSource.formDataControl.addItemInContainer({
                formItemList,
                widget,
                index: $event.newIndex,
                parentWidget,
                replace: true
            });
            this.ideFormData.list = formItemList;
        },
        getFormData() {
            return new Promise((resolve, reject) => {
                this.$refs.ylyForm.validate(async (err, values) => {
                    if (!err) {
                        return reject(err);
                    }
                    var CustomComponentFormData = await this.getCustomComponentFormData();
                    resolve({
                        ...this.formData,
                        CustomComponentFormData
                    });
                });
            });
        },
        async getCustomComponentFormData() {
            var customBusinessComponents = this.formSource.formComponentsControl.getCustomBusinessComponents();
            if (!customBusinessComponents || customBusinessComponents.size === 0) {
                return {};
            }
            var CustomComponentFormData = {};
            for (let [key, vNode] of customBusinessComponents) {
                CustomComponentFormData[key] = await vNode.getFormData();
            }
            return CustomComponentFormData;
        }
    }
};

/* script */ var __vue_script__$5 = script$5;
/* template */
var __vue_render__$5 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "yly-form-build" },
    [
      _c(
        "a-form-model",
        {
          ref: "ylyForm",
          attrs: {
            layout: "horizontal",
            model: _vm.formData,
            hideRequiredMark: false
          }
        },
        [
          _c("yly-form-item-container", {
            ref: "YlyFormItemContainerRef",
            attrs: {
              itemList: _vm.formItemList,
              formSource: _vm.formSource,
              renderScene: _vm.renderScene
            },
            on: { addItemInContainer: _vm.addItemInContainer }
          })
        ],
        1
      )
    ],
    1
  )
};
var __vue_staticRenderFns__$5 = [];
__vue_render__$5._withStripped = true;

  /* style */
  var __vue_inject_styles__$5 = undefined;
  /* scoped */
  var __vue_scope_id__$5 = undefined;
  /* module identifier */
  var __vue_module_identifier__$5 = undefined;
  /* functional template */
  var __vue_is_functional_template__$5 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$5 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
    __vue_inject_styles__$5,
    __vue_script__$5,
    __vue_scope_id__$5,
    __vue_is_functional_template__$5,
    __vue_module_identifier__$5,
    false,
    undefined,
    undefined,
    undefined
  );

var script$4 = {
    name: 'FormComponentConfig',
    components: {},
    props: {
        formSource: {
            type: Object,
            required: true
        },
        formData: {
            type: Object,
            default: () => {}
        }
    },
    data() {
        return {};
    },
    computed: {
        selectedComponent() {
            return this.formSource.selectedComponent;
        },
        selectedCompElementInfoList() {
            var editorConfig = this.formSource.formComponentsControl.getEditorConfigByCompCode(this.selectedComponent.code);
            if (editorConfig && Array.isArray(editorConfig.elementConfig)) {
                return editorConfig.elementConfig;
            }
            return [];
        },
        isRenderTableInfo() {
            if (this.formSource.sourceContent.formActionType === 'displayForm') return false;
            if (ylyFormConstants.NO_MODEL_COMPONENTS_CODE.includes(this.selectedComponent.code)) return false;
            var insetCustomBusinessList = this.formSource.constructor.FormComponentsControl.insetCustomBusinessList;
            if (Array.isArray(insetCustomBusinessList) && insetCustomBusinessList.includes(this.selectedComponent.code)) {
                return false;
            }
            return true;
        }
    },
    created() {},
    methods: {
        updateSelectItemInfo(itemInfo) {
            Object.assign(this.formSource.selectedComponent, itemInfo);
        }
    }
};

/* script */ var __vue_script__$4 = script$4;
/* template */
var __vue_render__$4 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "properties-centent" }, [
    _c(
      "div",
      { staticClass: "properties-body" },
      [
        _vm.selectedComponent.key
          ? _c(
              "a-form-model",
              {
                attrs: { "label-col": { span: 8 }, "wrapper-col": { span: 16 } }
              },
              [
                _vm.isRenderTableInfo
                  ? _c("TableAssociatedField", {
                      attrs: {
                        selectItem: _vm.selectedComponent,
                        formSource: _vm.formSource
                      },
                      on: { updateSelectItemInfo: _vm.updateSelectItemInfo }
                    })
                  : _vm._e(),
                _vm._v(" "),
                _c(
                  "a-card",
                  {
                    staticStyle: { "margin-top": "2px" },
                    attrs: { size: "small", title: _vm.$t("元素信息") }
                  },
                  _vm._l(_vm.selectedCompElementInfoList, function(
                    elementEditorInfo
                  ) {
                    return _c(elementEditorInfo.componentName, {
                      key: elementEditorInfo.code,
                      tag: "component",
                      attrs: {
                        editorInfo: elementEditorInfo,
                        selectItem: _vm.selectedComponent,
                        formSource: _vm.formSource
                      }
                    })
                  }),
                  1
                )
              ],
              1
            )
          : _c("div", { staticClass: "hint-box" }, [
              _vm._v("\n      " + _vm._s(_vm.$t("未选择控件")) + "\n    ")
            ])
      ],
      1
    )
  ])
};
var __vue_staticRenderFns__$4 = [];
__vue_render__$4._withStripped = true;

  /* style */
  var __vue_inject_styles__$4 = undefined;
  /* scoped */
  var __vue_scope_id__$4 = undefined;
  /* module identifier */
  var __vue_module_identifier__$4 = undefined;
  /* functional template */
  var __vue_is_functional_template__$4 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$4 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
    __vue_inject_styles__$4,
    __vue_script__$4,
    __vue_scope_id__$4,
    __vue_is_functional_template__$4,
    __vue_module_identifier__$4,
    false,
    undefined,
    undefined,
    undefined
  );

var script$3 = {
    mixins: [VxeGridMixin.VxeGridMixin],
    data() {
        return {
            visible: false,
            fnModuleCodes: [],
            activeKey: '',
            parentActiveKey: 'cloudFunc',
            searchFormData: {},
            gridOptions: {
                columns: this.getDefaultTableColsConfig([{
                    type: "radio"
                }, {
                    title: this.$t('函数Code'),
                    field: "functionCode"
                }, {
                    title: this.$t('函数名称'),
                    field: "functionName"
                }]),
                customLeftButtons: [],
                height: '620px',
                pagination: {
                    pageNo: 1,
                    pageSize: 10,
                    total: 0
                }
            },
            dictGridOptions: {
                data: [],
                columns: this.getDefaultTableColsConfig([{
                    type: "radio"
                }, {
                    title: this.$t('自编名称'),
                    field: "functionName"
                }, {
                    title: this.$t('字典编码'),
                    field: "functionCode"
                }]),
                customLeftButtons: [],
                height: '620px',
                pagination: {
                    pageNo: 1,
                    pageSize: 10,
                    total: 0
                }
            },
            pageConfig: {
                hiddenPageSize: false,
                showSizeChanger: true,
                pageSizeOptions: ["10", "20", "30", "40"],
                hideOnSinglePage: false
            },
            currentRow: null,
            callback: null
        };
    },
    async created() {
        this.parentActiveKey = 'cloudFunc';
        this.getFnModulesName();
    },
    methods: {
        getFnModulesName() {
            this.$api.getFnModule({
                projectId: this.$route.query.projectId
            }).then(res => {
                this.activeKey = res.result[0];
                this.fnModuleCodes = res.result || [];
                this.searchFormData.functionModel = this.activeKey;
                this.searchQuery();
            });
        },
        changeNav(key) {
            this.searchFormData.functionModel = key;
            this.pageConfig.hiddenPageSize = false;
            this.pageConfig.showSizeChanger = true;
            this.searchQuery();
        },
        handleChangeParentTabs(key) {
            if (key == 'Dict') {
                this.$api.getDictList({}, {
                    saas: this.$route.query.projectCode
                }).then(res => {
                    if (res.code == '200') {
                        let dictData = res.result || [];
                        this.dictGridOptions.data = dictData.map(val => ({
                            functionModel: 'Dict',
                            functionCode: val.dictCode,
                            functionName: val.dictName
                        }));
                        this.pageConfig.hiddenPageSize = true;
                        this.pageConfig.showSizeChanger = false;
                    }
                }).catch(err => {
                    this.dictList = [];
                    console.error(err);
                });
            }
        },
        selectEvents(row, callback) {
            this.visible = true;
            this.callback = callback;
            this.parentActiveKey = 'cloudFunc';
            this.getFnModulesName();
            this.gridOptions.pagination.pageNo = 1;
            this.gridOptions.pagination.pageSize = 10;
            this.searchQuery();
        },
        pageSizeChange(pageNo, pageSize) {
            this.gridOptions.pagination.pageNo = pageNo;
            this.gridOptions.pagination.pageSize = pageSize;
            this.searchQuery();
        },
        pageNoChange(pageNo) {
            this.gridOptions.pagination.pageNo = pageNo;
            this.searchQuery();
        },
        searchQuery() {
            var params = {
                ...this.searchFormData,
                pageNo: this.gridOptions.pagination.pageNo,
                pageSize: this.gridOptions.pagination.pageSize,
                projectId: this.$route.query.projectId
            };
            this.$api.queryFnByPage(params).then(res => {
                if (res.result) {
                    this.gridOptions.data = res.result.records;
                    this.gridOptions.pagination.total = res.result.total = res.result.total;
                } else {
                    this.gridOptions.data = [];
                    this.gridOptions.pagination.total = 0;
                }
            });
        },
        handleOk() {
            let checkRows = this.$refs['VGrid' + this.activeKey];
            let rows = [];
            if (this.parentActiveKey === 'cloudFunc') {
                if (checkRows.length != 1) {
                    this.$message.warning(this.$t('请选择一条数据'));
                    return;
                }
                rows = checkRows[0].getSelectedDta();
            } else if (this.parentActiveKey === 'Dict') {
                rows = this.$refs.VGridDict.getSelectedDta();
            }
            if (!rows[0]) return;
            let prop = {
                eventModule: rows[0].functionModel,
                eventFunctionName: rows[0].functionCode,
                buttonRefFunctionMethod: rows[0].functionModel + '.' + rows[0].functionCode,
                componentId: rows[0].id,
                componentName: rows[0].functionName
            };
            this.callback(prop);
            this.gridOptions.data = [];
            this.gridOptions.pagination.total = 0;
            this.visible = false;
        },
        handleCancel() {
            this.gridOptions.data = [];
            this.gridOptions.pagination.total = 0;
            this.visible = false;
        }
    }
};

/* script */ var __vue_script__$3 = script$3;

/* template */
var __vue_render__$3 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "a-modal",
    {
      attrs: {
        title: _vm.$t("展示形式"),
        visible: _vm.visible,
        width: "1200px",
        "ok-text": _vm.$t("确认"),
        "cancel-text": _vm.$t("取消"),
        dialogStyle: { top: "15px" }
      },
      on: { ok: _vm.handleOk, cancel: _vm.handleCancel }
    },
    [
      _c(
        "a-tabs",
        {
          on: { change: _vm.handleChangeParentTabs },
          model: {
            value: _vm.parentActiveKey,
            callback: function($$v) {
              _vm.parentActiveKey = $$v;
            },
            expression: "parentActiveKey"
          }
        },
        [
          _c(
            "a-tab-pane",
            { key: "cloudFunc", attrs: { tab: "选择云函数" } },
            [
              _c(
                "a-tabs",
                {
                  attrs: { "tab-position": "left", size: "small" },
                  on: { change: _vm.changeNav },
                  model: {
                    value: _vm.activeKey,
                    callback: function($$v) {
                      _vm.activeKey = $$v;
                    },
                    expression: "activeKey"
                  }
                },
                _vm._l(_vm.fnModuleCodes, function(code) {
                  return _c(
                    "a-tab-pane",
                    { key: code, attrs: { tab: code, forceRender: "" } },
                    [
                      _c(
                        "g-vxe-grid",
                        _vm._b(
                          {
                            ref: "VGrid" + code,
                            refInFor: true,
                            attrs: {
                              "row-config": { useKey: true },
                              pageConfig: _vm.pageConfig
                            },
                            on: {
                              "size-change": _vm.pageSizeChange,
                              "current-page-change": _vm.pageNoChange,
                              refreshData: _vm.searchQuery
                            }
                          },
                          "g-vxe-grid",
                          _vm.gridOptions,
                          false
                        )
                      )
                    ],
                    1
                  )
                }),
                1
              )
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "a-tab-pane",
            { key: "Dict", attrs: { tab: "数据字典" } },
            [
              _c(
                "g-vxe-grid",
                _vm._b(
                  {
                    ref: "VGridDict",
                    attrs: {
                      "row-config": { useKey: true },
                      pageConfig: _vm.pageConfig
                    },
                    on: {
                      "size-change": _vm.pageSizeChange,
                      "current-page-change": _vm.pageNoChange,
                      refreshData: _vm.searchQuery
                    }
                  },
                  "g-vxe-grid",
                  _vm.dictGridOptions,
                  false
                )
              )
            ],
            1
          )
        ],
        1
      )
    ],
    1
  )
};
var __vue_staticRenderFns__$3 = [];
__vue_render__$3._withStripped = true;

  /* style */
  var __vue_inject_styles__$3 = undefined;
  /* scoped */
  var __vue_scope_id__$3 = undefined;
  /* module identifier */
  var __vue_module_identifier__$3 = undefined;
  /* functional template */
  var __vue_is_functional_template__$3 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$3 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
    __vue_inject_styles__$3,
    __vue_script__$3,
    __vue_scope_id__$3,
    __vue_is_functional_template__$3,
    __vue_module_identifier__$3,
    false,
    undefined,
    undefined,
    undefined
  );

var script$2 = {
    name: 'FormAttrConfig',
    components: {
        CloudFuncModal: __vue_component__$3
    },
    props: {
        formSource: {
            type: Object,
            default: () => {}
        }
    },
    data() {
        return {
            previewOptions: {
                width: 850
            }
        };
    },
    computed: {
        renderClient() {
            return this.formSource.sourceContent && this.formSource.sourceContent.renderClient;
        },
        formPageConfig: {
            get() {
                return this.formSource.formDataControl.formPageConfig;
            },
            set(val) {
                debugger;

                this.formSource.formDataControl.formPageConfig = val;
            }
        }
    },
    methods: {
        selectCloudFn(type) {
            let vm = this;
            function updateData(selectedForm) {
                if (selectedForm) {
                    console.log(selectedForm);
                    if (type == 'before') {
                        Object.assign(vm.formPageConfig, {
                            loadButtonRefFunctionName: selectedForm.componentName,
                            loadButtonRefFunctionMethod: selectedForm.buttonRefFunctionMethod
                        });
                        vm.$set(vm.formPageConfig, 'loadButtonRefFunctionName', selectedForm.componentName);
                        vm.$set(vm.formPageConfig, 'loadButtonRefFunctionMethod', selectedForm.buttonRefFunctionMethod);
                        vm.$forceUpdate();
                    } else if (type === 'loadFormDataAfter') {
                        Object.assign(vm.formPageConfig, {
                            loadFormDataAfterFunctionName: selectedForm.componentName,
                            loadFormDataAfterFunctionMethod: selectedForm.buttonRefFunctionMethod
                        });
                        vm.$set(vm.formPageConfig, 'loadFormDataAfterFunctionName', selectedForm.componentName);
                        vm.$set(vm.formPageConfig, 'loadFormDataAfterFunctionMethod', selectedForm.buttonRefFunctionMethod);
                        vm.$forceUpdate();
                    } else if (type === 'navBarBtn') {
                        Object.assign(vm.formPageConfig, {
                            navBarBtnFunctionName: selectedForm.componentName,
                            navBarBtnFunctionMethod: selectedForm.buttonRefFunctionMethod
                        });
                        vm.$set(vm.formPageConfig, 'navBarBtnFunctionName', selectedForm.componentName);
                        vm.$set(vm.formPageConfig, 'navBarBtnFunctionMethod', selectedForm.buttonRefFunctionMethod);
                        vm.$forceUpdate();
                    } else {
                        Object.assign(vm.formPageConfig, {
                            saveButtonRefFunctionName: selectedForm.componentName,
                            saveButtonRefFunctionMethod: selectedForm.buttonRefFunctionMethod
                        });
                        vm.$set(vm.formPageConfig, 'saveButtonRefFunctionName', selectedForm.componentName);
                        vm.$set(vm.formPageConfig, 'saveButtonRefFunctionMethod', selectedForm.buttonRefFunctionMethod);
                        vm.$forceUpdate();
                    }
                }
            }
            this.$refs.CloudFuncModalRef.selectEvents({}, updateData);
        },
        handleClickClearFunc() {
            this.$set(this.formPageConfig, 'loadFormDataAfterFunctionName', '');
            this.$set(this.formPageConfig, 'loadFormDataAfterFunctionMethod', '');
            this.$set(this.formPageConfig, 'loadButtonRefFunctionName', '');
            this.$set(this.formPageConfig, 'loadButtonRefFunctionMethod', '');
            this.$set(this.formPageConfig, 'saveButtonRefFunctionName', '');
            this.$set(this.formPageConfig, 'saveButtonRefFunctionMethod', '');
            this.$set(this.formPageConfig, 'navBarBtnFunctionName', '');
            this.$set(this.formPageConfig, 'navBarBtnFunctionMethod', '');
        }
    }
};

/* script */ var __vue_script__$2 = script$2;

/* template */
var __vue_render__$2 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "kk-checkbox properties-centent" }, [
    _c(
      "div",
      { staticClass: "properties-body" },
      [
        _c(
          "a-form",
          { attrs: { "label-col": { span: 8 }, "wrapper-col": { span: 16 } } },
          [
            typeof _vm.formPageConfig.layout !== "undefined"
              ? _c(
                  "a-form-item",
                  { attrs: { label: _vm.$t("表单布局") } },
                  [
                    _c(
                      "a-radio-group",
                      {
                        attrs: { buttonStyle: "solid" },
                        model: {
                          value: _vm.formPageConfig.layout,
                          callback: function($$v) {
                            _vm.$set(_vm.formPageConfig, "layout", $$v);
                          },
                          expression: "formPageConfig.layout"
                        }
                      },
                      [
                        _c(
                          "a-radio-button",
                          { attrs: { value: "horizontal" } },
                          [
                            _vm._v(
                              "\n            " +
                                _vm._s(_vm.$t("水平")) +
                                "\n          "
                            )
                          ]
                        ),
                        _vm._v(" "),
                        _c("a-radio-button", { attrs: { value: "vertical" } }, [
                          _vm._v(
                            "\n            " +
                              _vm._s(_vm.$t("垂直")) +
                              "\n          "
                          )
                        ]),
                        _vm._v(" "),
                        _c("a-radio-button", { attrs: { value: "inline" } }, [
                          _vm._v(
                            "\n            " +
                              _vm._s(_vm.$t("行内")) +
                              "\n          "
                          )
                        ])
                      ],
                      1
                    )
                  ],
                  1
                )
              : _vm._e(),
            _vm._v(" "),
            _c(
              "a-form-item",
              {
                attrs: {
                  label: _vm.$t("labelCol(水平布局生效)"),
                  "label-col": { span: 14 },
                  "wrapper-col": { span: 10 }
                }
              },
              [
                _c(
                  "div",
                  { staticClass: "change-col-box" },
                  [
                    _c("a-slider", {
                      attrs: { id: "test", max: 24, min: 0 },
                      on: {
                        change: function($event) {
                          _vm.formPageConfig.wrapperCol.span =
                            24 - _vm.formPageConfig.labelCol.span;
                        }
                      },
                      model: {
                        value: _vm.formPageConfig.labelCol.span,
                        callback: function($$v) {
                          _vm.$set(_vm.formPageConfig.labelCol, "span", $$v);
                        },
                        expression: "formPageConfig.labelCol.span"
                      }
                    })
                  ],
                  1
                )
              ]
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              {
                attrs: {
                  label: _vm.$t("wrapperCol(水平布局生效)"),
                  "label-col": { span: 16 },
                  "wrapper-col": { span: 4 }
                }
              },
              [
                _c("a-input-number", {
                  model: {
                    value: _vm.formPageConfig.wrapperCol.span,
                    callback: function($$v) {
                      _vm.$set(_vm.formPageConfig.wrapperCol, "span", $$v);
                    },
                    expression: "formPageConfig.wrapperCol.span"
                  }
                })
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("预览框宽度") } },
              [
                _c("a-input-number", {
                  staticStyle: { width: "100%" },
                  model: {
                    value: _vm.previewOptions.width,
                    callback: function($$v) {
                      _vm.$set(_vm.previewOptions, "width", $$v);
                    },
                    expression: "previewOptions.width"
                  }
                })
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("表单CSS") } },
              [
                _c("a-input", {
                  model: {
                    value: _vm.formPageConfig.customStyle,
                    callback: function($$v) {
                      _vm.$set(_vm.formPageConfig, "customStyle", $$v);
                    },
                    expression: "formPageConfig.customStyle"
                  }
                })
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("表单属性") } },
              [
                typeof _vm.formPageConfig.hideRequiredMark !== "undefined"
                  ? _c("k-checkbox", {
                      attrs: { label: _vm.$t("隐藏必选标记") },
                      model: {
                        value: _vm.formPageConfig.hideRequiredMark,
                        callback: function($$v) {
                          _vm.$set(_vm.formPageConfig, "hideRequiredMark", $$v);
                        },
                        expression: "formPageConfig.hideRequiredMark"
                      }
                    })
                  : _vm._e()
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("是否打印") } },
              [
                _c("a-switch", {
                  model: {
                    value: _vm.formPageConfig.isPrint,
                    callback: function($$v) {
                      _vm.$set(_vm.formPageConfig, "isPrint", $$v);
                    },
                    expression: "formPageConfig.isPrint"
                  }
                })
              ],
              1
            ),
            _vm._v(" "),
            _vm.renderClient === "MOBILE"
              ? _c(
                  "a-form-item",
                  { attrs: { label: _vm.$t("导航栏展示") } },
                  [
                    _c("a-switch", {
                      model: {
                        value: _vm.formPageConfig.isShowNavBar,
                        callback: function($$v) {
                          _vm.$set(_vm.formPageConfig, "isShowNavBar", $$v);
                        },
                        expression: "formPageConfig.isShowNavBar"
                      }
                    })
                  ],
                  1
                )
              : _vm._e(),
            _vm._v(" "),
            _vm.formPageConfig.isShowNavBar
              ? _c(
                  "div",
                  [
                    _c(
                      "a-form-item",
                      { attrs: { label: _vm.$t("导航栏标题") } },
                      [
                        _c("a-input", {
                          model: {
                            value: _vm.formPageConfig.navBarTitle,
                            callback: function($$v) {
                              _vm.$set(_vm.formPageConfig, "navBarTitle", $$v);
                            },
                            expression: "formPageConfig.navBarTitle"
                          }
                        })
                      ],
                      1
                    ),
                    _vm._v(" "),
                    _c(
                      "a-form-item",
                      { attrs: { label: _vm.$t("导航栏右侧按钮") } },
                      [
                        _c("a-switch", {
                          model: {
                            value: _vm.formPageConfig.showRightButton,
                            callback: function($$v) {
                              _vm.$set(
                                _vm.formPageConfig,
                                "showRightButton",
                                $$v
                              );
                            },
                            expression: "formPageConfig.showRightButton"
                          }
                        })
                      ],
                      1
                    ),
                    _vm._v(" "),
                    _vm.formPageConfig.showRightButton
                      ? _c(
                          "a-form-item",
                          { attrs: { label: _vm.$t("按钮名称") } },
                          [
                            _c("a-input", {
                              model: {
                                value: _vm.formPageConfig.navBarBtnLabel,
                                callback: function($$v) {
                                  _vm.$set(
                                    _vm.formPageConfig,
                                    "navBarBtnLabel",
                                    $$v
                                  );
                                },
                                expression: "formPageConfig.navBarBtnLabel"
                              }
                            })
                          ],
                          1
                        )
                      : _vm._e(),
                    _vm._v(" "),
                    _vm.formPageConfig.showRightButton
                      ? _c(
                          "a-form-item",
                          { attrs: { label: _vm.$t("按钮绑定云函数") } },
                          [
                            _c(
                              "a-button",
                              {
                                attrs: { type: "primary" },
                                on: {
                                  click: function($event) {
                                    return _vm.selectCloudFn("navBarBtn")
                                  }
                                }
                              },
                              [_vm._v("\n            请选择\n          ")]
                            ),
                            _vm._v(" "),
                            _c("p", [
                              _vm._v(
                                "\n            " +
                                  _vm._s(
                                    !_vm.formPageConfig.navBarBtnFunctionName
                                      ? "默认"
                                      : _vm.formPageConfig
                                          .navBarBtnFunctionName +
                                          "(" +
                                          _vm.formPageConfig
                                            .navBarBtnFunctionMethod +
                                          ")"
                                  ) +
                                  "\n          "
                              )
                            ])
                          ],
                          1
                        )
                      : _vm._e()
                  ],
                  1
                )
              : _vm._e(),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("加载页面云函数") } },
              [
                _c(
                  "a-button",
                  {
                    attrs: { type: "primary" },
                    on: {
                      click: function($event) {
                        return _vm.selectCloudFn("before")
                      }
                    }
                  },
                  [_vm._v("\n          请选择\n        ")]
                ),
                _vm._v(" "),
                _c("p", [
                  _vm._v(
                    "\n          " +
                      _vm._s(
                        !_vm.formPageConfig.loadButtonRefFunctionName
                          ? "默认"
                          : _vm.formPageConfig.loadButtonRefFunctionName +
                              "(" +
                              _vm.formPageConfig.loadButtonRefFunctionMethod +
                              ")"
                      ) +
                      "\n        "
                  )
                ])
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("数据加载完成后") } },
              [
                _c(
                  "a-button",
                  {
                    attrs: { type: "primary" },
                    on: {
                      click: function($event) {
                        return _vm.selectCloudFn("loadFormDataAfter")
                      }
                    }
                  },
                  [_vm._v("\n          请选择\n        ")]
                ),
                _vm._v(" "),
                _c("p", [
                  _vm._v(
                    "\n          " +
                      _vm._s(
                        !_vm.formPageConfig.loadFormDataAfterFunctionName
                          ? "默认"
                          : _vm.formPageConfig.loadFormDataAfterFunctionName +
                              "(" +
                              _vm.formPageConfig
                                .loadFormDataAfterFunctionMethod +
                              ")"
                      ) +
                      "\n        "
                  )
                ])
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "a-form-item",
              { attrs: { label: _vm.$t("保存页面云函数") } },
              [
                _c(
                  "a-button",
                  {
                    attrs: { type: "primary" },
                    on: {
                      click: function($event) {
                        return _vm.selectCloudFn("save")
                      }
                    }
                  },
                  [_vm._v("\n          请选择\n        ")]
                ),
                _vm._v(" "),
                _c("p", [
                  _vm._v(
                    "\n          " +
                      _vm._s(
                        !_vm.formPageConfig.saveButtonRefFunctionName
                          ? "默认"
                          : _vm.formPageConfig.saveButtonRefFunctionName +
                              "(" +
                              _vm.formPageConfig.saveButtonRefFunctionMethod +
                              ")"
                      ) +
                      "\n        "
                  )
                ])
              ],
              1
            ),
            _vm._v(" "),
            _c("a-form-item", { attrs: { label: _vm.$t("提示") } }, [
              _vm._v(
                "\n        " +
                  _vm._s(_vm.$t("实际预览效果请点击预览查看")) +
                  "\n      "
              )
            ])
          ],
          1
        ),
        _vm._v(" "),
        _c(
          "a-button",
          {
            attrs: { type: "primary" },
            on: { click: _vm.handleClickClearFunc }
          },
          [_vm._v(" " + _vm._s(_vm.$t("重置")))]
        ),
        _vm._v(" "),
        _c("cloud-func-modal", { ref: "CloudFuncModalRef" })
      ],
      1
    )
  ])
};
var __vue_staticRenderFns__$2 = [];
__vue_render__$2._withStripped = true;

  /* style */
  var __vue_inject_styles__$2 = undefined;
  /* scoped */
  var __vue_scope_id__$2 = undefined;
  /* module identifier */
  var __vue_module_identifier__$2 = undefined;
  /* functional template */
  var __vue_is_functional_template__$2 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$2 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
    __vue_inject_styles__$2,
    __vue_script__$2,
    __vue_scope_id__$2,
    __vue_is_functional_template__$2,
    __vue_module_identifier__$2,
    false,
    undefined,
    undefined,
    undefined
  );

function getDefaultExportFromCjs (x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}

var vueTypes = {};

(function (exports) {
    var e, t = (e = require$$0) && "object" == typeof e && ("default" in e) ? e.default : e;
    function r(e, t) {
        for (var r = 0; r < t.length; r++) {
            var n = t[r];
            (n.enumerable = n.enumerable || !1, n.configurable = !0, ("value" in n) && (n.writable = !0), Object.defineProperty(e, n.key, n));
        }
    }
    function n(e, t, n) {
        return (t && r(e.prototype, t), n && r(e, n), e);
    }
    function o() {
        return (o = Object.assign || (function (e) {
            for (var t = 1; t < arguments.length; t++) {
                var r = arguments[t];
                for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
            }
            return e;
        })).apply(this, arguments);
    }
    function i(e, t) {
        (e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e.__proto__ = t);
    }
    function u(e, t) {
        if (null == e) return {};
        var r, n, o = {}, i = Object.keys(e);
        for (n = 0; n < i.length; n++) t.indexOf(r = i[n]) >= 0 || (o[r] = e[r]);
        return o;
    }
    function a(e) {
        return 1 == (null != (t = e) && "object" == typeof t && !1 === Array.isArray(t)) && "[object Object]" === Object.prototype.toString.call(e);
        var t;
    }
    var f = Object.prototype, c = f.toString, s = f.hasOwnProperty, l = /^\s*function (\w+)/;
    function p(e) {
        var t, r = null !== (t = null == e ? void 0 : e.type) && void 0 !== t ? t : e;
        if (r) {
            var n = r.toString().match(l);
            return n ? n[1] : "";
        }
        return "";
    }
    var y = function (e) {
        var t, r;
        return !1 !== a(e) && "function" == typeof (t = e.constructor) && !1 !== a(r = t.prototype) && !1 !== r.hasOwnProperty("isPrototypeOf");
    }, v = function (e) {
        return e;
    }, d = v;
    if ("production" !== undefined) {
        var h = "undefined" != typeof console;
        d = h ? function (e) {
            !1 === t.config.silent && console.warn("[VueTypes warn]: " + e);
        } : v;
    }
    var b = function (e, t) {
        return s.call(e, t);
    }, O = Number.isInteger || (function (e) {
        return "number" == typeof e && isFinite(e) && Math.floor(e) === e;
    }), g = Array.isArray || (function (e) {
        return "[object Array]" === c.call(e);
    }), m = function (e) {
        return "[object Function]" === c.call(e);
    }, j = function (e) {
        return y(e) && b(e, "_vueTypes_name");
    }, _ = function (e) {
        return y(e) && (b(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some(function (t) {
            return b(e, t);
        }));
    };
    function T(e, t) {
        return Object.defineProperty(e.bind(t), "__original", {
            value: e
        });
    }
    function x(e, t, r) {
        var n;
        void 0 === r && (r = !1);
        var o = !0, i = "";
        n = y(e) ? e : {
            type: e
        };
        var u = j(n) ? n._vueTypes_name + " - " : "";
        if (_(n) && null !== n.type) {
            if (void 0 === n.type) return o;
            if (!n.required && void 0 === t) return o;
            void 0 === n.type ? i = "any" : g(n.type) ? (o = n.type.some(function (e) {
                return !0 === x(e, t, !0);
            }), i = n.type.map(function (e) {
                return p(e);
            }).join(" or ")) : o = "Array" === (i = p(n)) ? g(t) : "Object" === i ? y(t) : "String" === i || "Number" === i || "Boolean" === i || "Function" === i ? (function (e) {
                if (null == e) return "";
                var t = e.constructor.toString().match(l);
                return t ? t[1] : "";
            })(t) === i : t instanceof n.type;
        }
        if (!o) {
            var a = u + 'value "' + t + '" should be of type "' + i + '"';
            return !1 === r ? (d(a), !1) : a;
        }
        if (b(n, "validator") && m(n.validator)) {
            var f = d, c = [];
            if ((d = function (e) {
                c.push(e);
            }, o = n.validator(t), d = f, !o)) {
                var s = (c.length > 1 ? "* " : "") + c.join("\n* ");
                return (c.length = 0, !1 === r ? (d(s), o) : s);
            }
        }
        return o;
    }
    function w(e, t) {
        var r = Object.defineProperties(t, {
            _vueTypes_name: {
                value: e,
                writable: !0
            },
            isRequired: {
                get: function () {
                    return (this.required = !0, this);
                }
            },
            def: {
                value: function (e) {
                    return void 0 === e ? (b(this, "default") && delete this.default, this) : m(e) || !0 === x(this, e, !0) ? (this.default = g(e) ? function () {
                        return [].concat(e);
                    } : y(e) ? function () {
                        return Object.assign({}, e);
                    } : e, this) : (d(this._vueTypes_name + ' - invalid default value: "' + e + '"'), this);
                }
            }
        }), n = r.validator;
        return (m(n) && (r.validator = T(n, r)), r);
    }
    function k(e, t) {
        var r = w(e, t);
        return Object.defineProperty(r, "validate", {
            value: function (e) {
                return (m(this.validator) && d(this._vueTypes_name + " - calling .validate() will overwrite the current custom validator function. Validator info:\n" + JSON.stringify(this)), this.validator = T(e, this), this);
            }
        });
    }
    function P(e, t, r) {
        var n, o, i = (n = t, o = {}, Object.getOwnPropertyNames(n).forEach(function (e) {
            o[e] = Object.getOwnPropertyDescriptor(n, e);
        }), Object.defineProperties({}, o));
        if ((i._vueTypes_name = e, !y(r))) return i;
        var a, f, c = r.validator, s = u(r, ["validator"]);
        if (m(c)) {
            var l = i.validator;
            (l && (l = null !== (f = (a = l).__original) && void 0 !== f ? f : a), i.validator = T(l ? function (e) {
                return l.call(this, e) && c.call(this, e);
            } : c, i));
        }
        return Object.assign(i, s);
    }
    function A(e) {
        return e.replace(/^(?!\s*$)/gm, "  ");
    }
    var q = function () {
        return k("any", {});
    }, E = function () {
        return k("function", {
            type: Function
        });
    }, N = function () {
        return k("boolean", {
            type: Boolean
        });
    }, V = function () {
        return k("string", {
            type: String
        });
    }, S = function () {
        return k("number", {
            type: Number
        });
    }, F = function () {
        return k("array", {
            type: Array
        });
    }, D = function () {
        return k("object", {
            type: Object
        });
    }, L = function () {
        return w("integer", {
            type: Number,
            validator: function (e) {
                return O(e);
            }
        });
    }, Y = function () {
        return w("symbol", {
            validator: function (e) {
                return "symbol" == typeof e;
            }
        });
    };
    function B(e, t) {
        if ((void 0 === t && (t = "custom validation failed"), "function" != typeof e)) throw new TypeError("[VueTypes error]: You must provide a function as argument");
        return w(e.name || "<<anonymous function>>", {
            validator: function (r) {
                var n = e(r);
                return (n || d(this._vueTypes_name + " - " + t), n);
            }
        });
    }
    function M(e) {
        if (!g(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
        var t = 'oneOf - value should be one of "' + e.join('", "') + '".', r = e.reduce(function (e, t) {
            if (null != t) {
                var r = t.constructor;
                -1 === e.indexOf(r) && e.push(r);
            }
            return e;
        }, []);
        return w("oneOf", {
            type: r.length > 0 ? r : void 0,
            validator: function (r) {
                var n = -1 !== e.indexOf(r);
                return (n || d(t), n);
            }
        });
    }
    function I(e) {
        if (!g(e)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
        for (var t = !1, r = [], n = 0; n < e.length; n += 1) {
            var o = e[n];
            if (_(o)) {
                if (j(o) && "oneOf" === o._vueTypes_name) {
                    r = r.concat(o.type || []);
                    continue;
                }
                if ((m(o.validator) && (t = !0), void 0 !== o.type)) {
                    r = r.concat(o.type);
                    continue;
                }
            }
            r.push(o);
        }
        return (r = r.filter(function (e, t) {
            return r.indexOf(e) === t;
        }), w("oneOfType", t ? {
            type: r,
            validator: function (t) {
                var r = [], n = e.some(function (e) {
                    var n = x(j(e) && "oneOf" === e._vueTypes_name ? e.type || null : e, t, !0);
                    return ("string" == typeof n && r.push(n), !0 === n);
                });
                return (n || d("oneOfType - provided value does not match any of the " + r.length + " passed-in validators:\n" + A(r.join("\n"))), n);
            }
        } : {
            type: r
        }));
    }
    function J(e) {
        return w("arrayOf", {
            type: Array,
            validator: function (t) {
                var r, n = t.every(function (t) {
                    return !0 === (r = x(e, t, !0));
                });
                return (n || d("arrayOf - value validation error:\n" + A(r)), n);
            }
        });
    }
    function R(e) {
        return w("instanceOf", {
            type: e
        });
    }
    function $(e) {
        return w("objectOf", {
            type: Object,
            validator: function (t) {
                var r, n = Object.keys(t).every(function (n) {
                    return !0 === (r = x(e, t[n], !0));
                });
                return (n || d("objectOf - value validation error:\n" + A(r)), n);
            }
        });
    }
    function z(e) {
        var t = Object.keys(e), r = t.filter(function (t) {
            var r;
            return !!(null === (r = e[t]) || void 0 === r ? void 0 : r.required);
        }), n = w("shape", {
            type: Object,
            validator: function (n) {
                var o = this;
                if (!y(n)) return !1;
                var i = Object.keys(n);
                if (r.length > 0 && r.some(function (e) {
                    return -1 === i.indexOf(e);
                })) {
                    var u = r.filter(function (e) {
                        return -1 === i.indexOf(e);
                    });
                    return (d(1 === u.length ? 'shape - required property "' + u[0] + '" is not defined.' : 'shape - required properties "' + u.join('", "') + '" are not defined.'), !1);
                }
                return i.every(function (r) {
                    if (-1 === t.indexOf(r)) return !0 === o._vueTypes_isLoose || (d('shape - shape definition does not include a "' + r + '" property. Allowed keys: "' + t.join('", "') + '".'), !1);
                    var i = x(e[r], n[r], !0);
                    return ("string" == typeof i && d('shape - "' + r + '" property validation error:\n ' + A(i)), !0 === i);
                });
            }
        });
        return (Object.defineProperty(n, "_vueTypes_isLoose", {
            writable: !0,
            value: !1
        }), Object.defineProperty(n, "loose", {
            get: function () {
                return (this._vueTypes_isLoose = !0, this);
            }
        }), n);
    }
    var C = (function () {
        function e() {}
        return (e.extend = function (e) {
            var t = this;
            if (g(e)) return (e.forEach(function (e) {
                return t.extend(e);
            }), this);
            var r = e.name, n = e.validate, o = void 0 !== n && n, i = e.getter, a = void 0 !== i && i, f = u(e, ["name", "validate", "getter"]);
            if (b(this, r)) throw new TypeError('[VueTypes error]: Type "' + r + '" already defined');
            var c, s = f.type;
            return j(s) ? (delete f.type, Object.defineProperty(this, r, a ? {
                get: function () {
                    return P(r, s, f);
                }
            } : {
                value: function () {
                    var e, t = P(r, s, f);
                    return (t.validator && (t.validator = (e = t.validator).bind.apply(e, [t].concat([].slice.call(arguments)))), t);
                }
            })) : (c = a ? {
                get: function () {
                    var e = Object.assign({}, f);
                    return o ? k(r, e) : w(r, e);
                },
                enumerable: !0
            } : {
                value: function () {
                    var e, t, n = Object.assign({}, f);
                    return (e = o ? k(r, n) : w(r, n), n.validator && (e.validator = (t = n.validator).bind.apply(t, [e].concat([].slice.call(arguments)))), e);
                },
                enumerable: !0
            }, Object.defineProperty(this, r, c));
        }, n(e, null, [{
            key: "any",
            get: function () {
                return q();
            }
        }, {
            key: "func",
            get: function () {
                return E().def(this.defaults.func);
            }
        }, {
            key: "bool",
            get: function () {
                return N().def(this.defaults.bool);
            }
        }, {
            key: "string",
            get: function () {
                return V().def(this.defaults.string);
            }
        }, {
            key: "number",
            get: function () {
                return S().def(this.defaults.number);
            }
        }, {
            key: "array",
            get: function () {
                return F().def(this.defaults.array);
            }
        }, {
            key: "object",
            get: function () {
                return D().def(this.defaults.object);
            }
        }, {
            key: "integer",
            get: function () {
                return L().def(this.defaults.integer);
            }
        }, {
            key: "symbol",
            get: function () {
                return Y();
            }
        }]), e);
    })();
    function G(e) {
        var t;
        return (void 0 === e && (e = {
            func: function () {},
            bool: !0,
            string: "",
            number: 0,
            array: function () {
                return [];
            },
            object: function () {
                return {};
            },
            integer: 0
        }), (t = (function (t) {
            function r() {
                return t.apply(this, arguments) || this;
            }
            return (i(r, t), n(r, null, [{
                key: "sensibleDefaults",
                get: function () {
                    return o({}, this.defaults);
                },
                set: function (t) {
                    this.defaults = !1 !== t ? o({}, !0 !== t ? t : e) : {};
                }
            }]), r);
        })(C)).defaults = o({}, e), t);
    }
    (C.defaults = {}, C.custom = B, C.oneOf = M, C.instanceOf = R, C.oneOfType = I, C.arrayOf = J, C.objectOf = $, C.shape = z, C.utils = {
        validate: function (e, t) {
            return !0 === x(t, e, !0);
        },
        toType: function (e, t, r) {
            return (void 0 === r && (r = !1), r ? k(e, t) : w(e, t));
        }
    });
    var H = (function (e) {
        function t() {
            return e.apply(this, arguments) || this;
        }
        return (i(t, e), t);
    })(G());
    (Object.defineProperty(exports, "__esModule", {
        value: !0
    }), exports.any = q, exports.array = F, exports.arrayOf = J, exports.bool = N, exports.createTypes = G, exports.custom = B, exports.default = H, exports.fromType = P, exports.func = E, exports.instanceOf = R, exports.integer = L, exports.number = S, exports.object = D, exports.objectOf = $, exports.oneOf = M, exports.oneOfType = I, exports.shape = z, exports.string = V, exports.symbol = Y, exports.toType = w, exports.toValidableType = k, exports.validateType = x);
})(vueTypes);
var VueTypes = getDefaultExportFromCjs(vueTypes);

var script$1 = {
    name: 'FormConfigPanel',
    props: {
        hideModel: VueTypes.bool.def(false),
        formSource: VueTypes.object.def({}),
        formData: VueTypes.object.def({})
    },
    components: {
        FormComponentConfig: __vue_component__$4,
        FormAttrConfig: __vue_component__$2
    },
    data() {
        return {
            tabPaneActive: '1',
            showProperties: false
        };
    },
    watch: {
        'formSource.selectedComponent': {
            handler(newVl, oldVal) {
                this.tabPaneActive = '1';
            }
        }
    },
    methods: {}
};

/* script */ var __vue_script__$1 = script$1;
/* template */
var __vue_render__$1 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "form-config-panel" },
    [
      _c(
        "a-tabs",
        {
          attrs: { size: "small" },
          model: {
            value: _vm.tabPaneActive,
            callback: function($$v) {
              _vm.tabPaneActive = $$v;
            },
            expression: "tabPaneActive"
          }
        },
        [
          _c(
            "a-tab-pane",
            { key: "1", attrs: { tab: _vm.$t("组件属性") } },
            [
              _c("form-component-config", {
                ref: "formItemProp",
                staticClass: "form-item-properties",
                class: { "show-properties": _vm.showProperties },
                attrs: {
                  selectItem: _vm.formSource.selectedComponent,
                  formSource: _vm.formSource,
                  hideModel: _vm.hideModel
                },
                on: {
                  handleHide: function($event) {
                    _vm.showProperties = false;
                  }
                }
              })
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "a-tab-pane",
            { key: "2", attrs: { tab: _vm.$t("表单属性") } },
            [_c("form-attr-config", { attrs: { formSource: _vm.formSource } })],
            1
          )
        ],
        1
      )
    ],
    1
  )
};
var __vue_staticRenderFns__$1 = [];
__vue_render__$1._withStripped = true;

  /* style */
  var __vue_inject_styles__$1 = undefined;
  /* scoped */
  var __vue_scope_id__$1 = undefined;
  /* module identifier */
  var __vue_module_identifier__$1 = undefined;
  /* functional template */
  var __vue_is_functional_template__$1 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__$1 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
    __vue_inject_styles__$1,
    __vue_script__$1,
    __vue_scope_id__$1,
    __vue_is_functional_template__$1,
    __vue_module_identifier__$1,
    false,
    undefined,
    undefined,
    undefined
  );

var script = {
    name: 'YlyFormDesign',
    components: {
        YlyFormDesignList: __vue_component__$8,
        FormConfigPanel: __vue_component__$1,
        YlyFormBuild: __vue_component__$5
    },
    provide() {
        return {
            getFormRenderPageConfig: () => this.formConfigData.formPageConfig
        };
    },
    props: {
        tableComponentList: {
            type: Array,
            default: () => []
        },
        showComponentConfig: {
            type: Object,
            default: () => {}
        },
        formBaseInfo: {
            type: Object,
            default: () => {}
        }
    },
    mixins: [FormMixin],
    data() {
        return {};
    },
    computed: {
        allDbFormFieldList() {
            if (this.formSource.formDataControl) {
                return this.formSource.formDataControl.allDbFormFieldList || [];
            }
            return [];
        }
    },
    created() {},
    methods: {
        validateFormDesign() {
            let noModelItems = [];
            return new Promise((resolve, reject) => {
                var allFlattenComponentList = this.formSource.formDataControl.getAllFlattenComponentList();
                var insetCustomBusinessList = this.formSource.constructor.FormComponentsControl.insetCustomBusinessList;
                var validateFormModelComponents = allFlattenComponentList.filter(item => {
                    if (!Array.isArray(insetCustomBusinessList) || insetCustomBusinessList.length === 0) {
                        return !ylyFormConstants.NO_MODEL_COMPONENTS_CODE.includes(item.code);
                    } else {
                        return !ylyFormConstants.NO_MODEL_COMPONENTS_CODE.includes(item.code) && !insetCustomBusinessList.includes(item.code);
                    }
                });
                var alreadyBindFields = [];
                validateFormModelComponents.forEach(item => {
                    if (ylyFormConstants.MULTI_MODEL_COMPONENTS_CODE.includes(item.code)) {
                        var validateFields = ['areaKey', 'cityKey', 'provinceKey'];
                        validateFields.forEach(field => {
                            item.bindDataInfo[field] ? alreadyBindFields.push(item.bindDataInfo[field]) : noModelList.push(item);
                        });
                    } else if (ylyFormConstants.SELECT_COMPONENT_CODE.includes(item.code)) {
                        item.model ? alreadyBindFields.push(item.model) : noModelItems.push(item);
                        item.fieldRelatedName && alreadyBindFields.push(item.fieldRelatedName);
                    } else {
                        item.model ? alreadyBindFields.push(item.model) : noModelItems.push(item);
                    }
                });
                noModelItems = noModelItems.filter(item => !item.temporaryField);
                if (noModelItems.length > 0) {
                    this.$message.warning(noModelItems.map(item => item.label).join(", ") + this.$t('需要绑定数据表字段'));
                    return reject({
                        status: false,
                        noModelItems
                    });
                }
                var noBindComponentFields = [];
                this.allDbFormFieldList.filter(item => item.dbIsNull == 0 && item.dbIsKey != 1).forEach(item => {
                    if (!alreadyBindFields.includes(item.dbFieldName) && !alreadyBindFields.includes(item.dbFieldNameUp)) {
                        noBindComponentFields.push(item);
                    }
                });
                if (noBindComponentFields.length > 0) {
                    this.$confirm({
                        title: '确认?',
                        content: `${noBindComponentFields.map(item => item.dbFieldTxt).join(", ")}是必填字段, 确认不绑定表单组件`,
                        okText: this.$t('确认'),
                        cancelText: this.$t('取消'),
                        width: '500px',
                        onOk: () => {
                            resolve({
                                status: true,
                                noBindComponentFields
                            });
                        },
                        onCancel: () => {
                            reject({
                                status: false,
                                noBindComponentFields
                            });
                        }
                    });
                } else {
                    resolve({
                        status: true
                    });
                }
            });
        },
        getAlreadyBindFieldList() {
            var alreadyBindFieldList = [];
            var allFlattenComponentList = this.formSource.formDataControl.getAllFlattenComponentList();
            allFlattenComponentList.filter(item => !ylyFormConstants.NO_MODEL_COMPONENTS_CODE.includes(item.code)).forEach(item => {
                var fieldsConfig = this.getFieldConfigByComponent(item);
                alreadyBindFieldList.push(...fieldsConfig);
            });
            return alreadyBindFieldList;
        },
        getFieldConfigByComponent(component) {
            var fieldsConfig = [];
            if (ylyFormConstants.MULTI_MODEL_COMPONENTS_CODE.includes(component.code)) {
                var validateFields = ['areaKey', 'cityKey', 'provinceKey', 'areaNameKey', 'cityNameKey', 'provinceNameKey'];
                validateFields.forEach(field => {
                    let fieldConfig = component.bindDataInfo[field] && this.findFieldConfigByFieldName(component.bindDataInfo[field]);
                    if (fieldConfig) {
                        fieldConfig.isShowForm = 1;
                        fieldConfig.isQuery = 0;
                        fieldConfig.isShowList = 1;
                        fieldConfig.fieldTitle = component.label;
                        fieldConfig.columnId = component.bindDataInfo[field.substring(0, field.length - 3) + 'Id'];
                        fieldConfig.queryShowType = "pca";
                        fieldsConfig.push(fieldConfig);
                    }
                });
            } else if (ylyFormConstants.SELECT_COMPONENT_CODE.includes(component.code)) {
                let fieldConfig = this.findFieldConfigByFieldName(component.model);
                if (fieldConfig) {
                    fieldConfig.fieldDefaultValue = component.defaultValue;
                    fieldConfig.isShowForm = component.type == "textField" ? 0 : 1;
                    if (!this.formConfigData.formPageConfig.isEdit) {
                        fieldConfig.isQuery = 0;
                        fieldConfig.isShowList = 1;
                        fieldConfig.queryShowType = ylyFormConstants.QUERY_COMPONENT_TYPE_MAP[component.code] || 'text';
                    }
                    var {distal = {}, options = []} = component;
                    fieldConfig = {
                        ...fieldConfig,
                        ...distal,
                        columnId: component.columnId,
                        dictData: options.map(item => item.value).join(",")
                    };
                    if (component.distal && Array.isArray(component.distal.dictCondition)) {
                        fieldConfig.dictCondition = undefined;
                    }
                    if (component.distal && Array.isArray(component.distal.dictConditionList)) {
                        fieldConfig.dictConditionList = JSON.stringify(component.distal.dictConditionList);
                    }
                    if (Array.isArray(fieldConfig.fieldDefaultValue)) {
                        fieldConfig.fieldDefaultValue = fieldConfig.fieldDefaultValue.join(",");
                    }
                    fieldConfig.columnId = component.columnId;
                    fieldConfig.fieldTitle = component.label;
                    fieldConfig.isUserAttri = component.isUserAttri ? 1 : 0;
                    fieldConfig.userAttriName = component.userAttriName;
                    fieldConfig.userAttriColumnId = component.userAttriColumnId;
                    fieldsConfig.push(fieldConfig);
                }
                if (component.fieldRelatedName) {
                    var fieldRelatedNameConfig = this.findFieldConfigByFieldName(component.fieldRelatedName);
                    if (fieldRelatedNameConfig) {
                        fieldRelatedNameConfig.fieldTitle = component.label;
                        fieldRelatedNameConfig.columnId = component.fieldRelateId;
                        fieldsConfig.push(fieldRelatedNameConfig);
                    }
                }
            } else {
                let fieldConfig = this.findFieldConfigByFieldName(component.model);
                if (fieldConfig) {
                    fieldConfig.fieldDefaultValue = component.defaultValue;
                    fieldConfig.isShowForm = component.type == "textField" ? 0 : 1;
                    if (!this.formConfigData.formPageConfig.isEdit) {
                        fieldConfig.isQuery = 0;
                        fieldConfig.isShowList = 1;
                        fieldConfig.queryShowType = ylyFormConstants.QUERY_COMPONENT_TYPE_MAP[component.code] || 'text';
                    }
                    fieldConfig.columnId = component.columnId;
                    fieldConfig.fieldTitle = component.label;
                    fieldsConfig.push(fieldConfig);
                }
            }
            return fieldsConfig;
        },
        findFieldConfigByFieldName(modelField) {
            var fieldConfig = cloneDeep(this.allDbFormFieldList.find(item => item.dbFieldName === modelField || item.dbFieldNameUp === modelField));
            return fieldConfig;
        },
        setCustomBusinessList(customBsCompCodeList) {
            this.formSource.formComponentsControl.setCustomBusinessList(Array.isArray(customBsCompCodeList) ? customBsCompCodeList : []);
            this.$refs.ylyFormList.initGroupList && this.$refs.ylyFormList.initGroupList();
        },
        getFormDesignConfig() {
            return {
                formPageConfig: this.formConfigData.formPageConfig,
                formItemList: this.deleteComponentNoSaveField(cloneDeep(this.formConfigData.formItemList))
            };
        },
        deleteComponentNoSaveField(formItemList) {
            var deleteField = ['desc', 'field', 'renderComponent', 'editorConfig'];
            formItemList.forEach(item => {
                deleteField.forEach(field => {
                    delete item[field];
                });
                if (item.children) {
                    this.deleteComponentNoSaveField(item.children);
                }
            });
            return formItemList;
        }
    }
};

/* script */ var __vue_script__ = script;
/* template */
var __vue_render__ = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "yly-form-design" },
    [
      _c("yly-form-design-list", {
        ref: "ylyFormList",
        attrs: {
          formSource: _vm.formSource,
          formActionType: _vm.formActionType,
          tableComponentList: _vm.tableComponentList,
          showComponentConfig: _vm.showComponentConfig
        }
      }),
      _vm._v(" "),
      _vm.renderClient === "MOBILE"
        ? _c("YlyMobileFormBuild", {
            attrs: { formSource: _vm.formSource, renderScene: "ide" }
          })
        : _c("yly-form-build", {
            staticClass: "yly-form-ide-panel",
            attrs: { formSource: _vm.formSource, renderScene: "ide" }
          }),
      _vm._v(" "),
      _c("form-config-panel", {
        staticClass: "form-design-right",
        attrs: { formSource: _vm.formSource }
      })
    ],
    1
  )
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;

  /* style */
  var __vue_inject_styles__ = undefined;
  /* scoped */
  var __vue_scope_id__ = undefined;
  /* module identifier */
  var __vue_module_identifier__ = undefined;
  /* functional template */
  var __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  var __vue_component__ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__.install = function (vue) {
    vue.component(__vue_component__.name, __vue_component__);
};

module.exports = __vue_component__;
